from api_post_class import *
import json
from sys import exit
from config import *
import time

if __name__ == "__main__":
    authType = 1
    operation = "CallCenter"
    function = "getClientToken"
    taskName = str(time.time())
    workNumbers = "hhhlll2"
    params = {
        "workNumber": workNumbers,
        "password": "123456",
    }
    f = ApiPost(auth_info, domain, version, "json")
    f.set_func_mode(operation, function, authType)
    rsp = f.post_info_to_api(params)
    print(rsp)
    try:
        if rsp['resp']['respCode'] != 0:
            print("Error, please check and retry")
    except Exception as e:
        print(e)
